package com.hqm.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.hqm.meta.User;

@Repository("userDao")
public interface UserDao {
	boolean addUser(User user);
	
	boolean deleteUser(Integer id);
	
	boolean updateUser(User user);
	/**
	 * 通过用户id获取数据苦中的用户信息
	 * @param id
	 * @return
	 */
	@Select("SELECT * FROM user WHERE id=#{id}")
	User getUserById(@Param("id") Integer id);
	/**
	 * 通过用户名获取数据苦中的用户信息
	 * @param userName
	 * @return
	 */
	@Select("SELECT * FROM user WHERE userName=#{userName}")
	User getUserByUserName(@Param("userName") String userName);
}
